package com.example.newnoke.ui;

import android.os.Bundle;
import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.example.newnoke.R;
import com.example.newnoke.data.YJMXData;
import com.example.newnoke.mvp.presenter.ZhuanPresenter;
import com.example.newnoke.mvp.view.IZhuanV;
import com.example.newnoke.utils.API;
import com.geya.jbase.baseactivity.BaseRVActivity;
import com.geya.jbase.constant.RequestType;

import java.util.HashMap;
import java.util.List;

public class YJJLActivity extends BaseRVActivity <YJMXData.DataBean.ListBean, ZhuanPresenter> implements IZhuanV {



    @Override
    public ZhuanPresenter newP() {
        return new ZhuanPresenter(this);
    }


    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mImmersionBar.init();
        setContentView(R.layout.activity_list);

        initBaseView();
        mTitleButton.setTitles("明细");
        initRV(0,0);

        HashMap<String,Object> map = new HashMap<>();
        map.put("level",getIntent().getStringExtra("level"));
        requestData(RequestType.OKGO_POST,RequestType.ADDRESS, API.CHILD_CHAINS, YJMXData.class,map);
    }
    @Override
    public Class setClass() {
        return YJMXData.DataBean.ListBean.class;
    }

    @Override
    public BaseQuickAdapter initAdapter(List<YJMXData.DataBean.ListBean> list) {
        return new BaseQuickAdapter<YJMXData.DataBean.ListBean,BaseViewHolder>(R.layout.list_item_text,list) {

            @Override
            protected void convert(BaseViewHolder helper, YJMXData.DataBean.ListBean item) {

                helper.setText(R.id.sj,item.getInputtime())
                        .setText(R.id.shouyi,item.getMobile())
                        .setText(R.id.bz,item.getTotal_price());

            }
        };
    }

    @Override
    public void pay(String s, boolean bl) {

    }
}
